home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Gamer (Italian) 30
/
PC Gamer IT CD 30 1-2.iso
/
MOTS
/
GAMEDATA
/
RESOURCE
/
JKMRES.GOO
/
cog_class_boxturret4.cog
< prev
next >
Wrap
Text File
|
1998-02-25
|
2KB
|
94 lines
# Jedi Knight Cog Script
#
# CLASS_BOXTURRET4.COG
#
# Class COG for a turret
#
# Alternate the firepoint between two points.
#
# [YB]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
symbols
template powerup=+dEnergyCell local
thing newThing local
int player local
#message fire
#message created
message killed mask=0xfff
message skill
message damaged
end
# ========================================================================================
code
//created:
// SetThingFireOffset(GetSenderRef(), '0.2 0.0 0.0');
// SetThingUserData(GetSenderRef(), 0);
// Return;
# ........................................................................................
//fire:
// if(GetThingUserData(GetSenderRef()) == 0)
// {
// SetThingFireOffset(GetSenderRef(), '-0.2 0.0 0.0');
// SetThingUserData(GetSenderRef(), 1);
// }
// else
// {
// SetThingFireOffset(GetSenderRef(), '0.2 0.0 0.0');
// SetThingUserData(GetSenderRef(), 0);
// }
//
// Return;
# ........................................................................................
killed:
rval = Rand();
if(rval < 0.2)
{
newThing = CreateThing(powerup, GetSenderRef());
SetLifeleft(newThing, 200.0);
}
Return;
# ........................................................................................
skill:
ReturnEx(-1);
Return;
# ........................................................................................
damaged:
if(GetParam(1) == 1) ReturnEx(0); // turrets immune to impact damage
player = GetLocalPlayerThing();
if(GetThingParent(GetSourceRef()) == player)
{
if(GetCurWeapon(player) == 1)
{
if(GetThingHealth(player) > 1)
{
DamageThing(player, 1, 0x1, player);
}
}
}
Return;
end